<?php
/**
 * Login_Model_Checkuserobject
 * check user object
 * @author Adrian Stolarski
 */
class Login_Model_Checkuserobject implements Login_Model_Mainable {
    
    /**
     *
     * @var type $check_user_object
     * check user object
     */
    public $check_user_object;
    /**
     *
     * @var type $redirect_action
     * redirect action
     */
    public $redirect_action;
    /**
     * constructor()
     */
    public function __construct() {
        $this->check_user_object = new Login_Data_Checkuserobject;
    }
    
    /**
     * main()
     * login redirect decision
     * 
     * @param array $variables
     */
    public function main(array $variables = null) {
        $user_object = $this->check_user_object->main($variables);
        //var_dump($user_object);
        //die();
        if(!is_null($user_object) || ($user_object['user_activity'] == 2)){
            $this->redirect_action = new Login_Data_Loginredirect;
            $this->redirect_action->main($variables);
        }
    }

}
